#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
	int n, m;
	cin >> n >> m;
	vector<int>nums;
	for (int i = 0; i < n; i++) {
		int x;
		scanf("%d", &x);
		nums.push_back(x);
	}
	for (int i = 0; i < m; i++) {
		int target;
		int pos = -2;
		scanf("%d", &target);
		int head = 0, rear = nums.size() - 1;
		while (head < rear - 1) {
			if (target <= nums[(head + rear) / 2])
				rear = (head + rear) / 2;
			else if (target > nums[(head + rear) / 2])
				head = (head + rear) / 2;
		}
		if (target == nums[head]) pos = head;
		else if (target == nums[rear]) pos = rear;
		pos += 1;
		printf("%d ", pos);
	}
	return 0;
}
